/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.wechat.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 业务消息Entity
 * @author Jakemanse
 * @version 2014-01-13
 */
@Entity
@Table(name = "wp_business_news_reply")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class BusinessNewsReply extends BaseEntity {
	
	public final static String MSG_TYPE_BUSINESS = "business";		//业务，活动
	public final static String MSG_TYPE_SECKILL  = "seckill";		//秒杀
	public final static String MSG_TYPE_SHARE    = "share";			//有奖转发
	public final static String MSG_TYPE_COUPON   = "coupon";		//优惠券
	public final static String MSG_TYPE_MEMBER   = "member";		//会员申请
	
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private User user; 		// 用户
	private String type;	//属于哪个服务对象类型 :lottery,seckill,share,coupon,...
	private String sourceId;	//所属的对象的Id
	private String successFlag;	//是否成功信息回复	1:是   0:否
	private String title;	//微信ID
	private String description; 	// 微信描述
	private String filePath;		//存储路径
	private String picUrl;	//Token 微信接口标识
	private String url; 		// 用户
	private Integer sort; // 排序
	private Integer articleCount; // 图文数量
	private Date createTime;	// 创建日期
	private Date updateTime;	//更新时间
	
	
	

	public BusinessNewsReply() {
		this.createTime = new Date();
	}

	public BusinessNewsReply(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_wechat_businessNewsReply")
	//@SequenceGenerator(name = "seq_wechat_businessNewsReply", sequenceName = "seq_wechat_businessNewsReply")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name="user_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	

	
	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}


	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public String getPicUrl() {
		return picUrl;
	}

	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}


	public Integer getArticleCount() {
		return articleCount;
	}

	public void setArticleCount(Integer articleCount) {
		this.articleCount = articleCount;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getSuccessFlag() {
		return successFlag;
	}

	public void setSuccessFlag(String successFlag) {
		this.successFlag = successFlag;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getSourceId() {
		return sourceId;
	}

	public void setSourceId(String sourceId) {
		this.sourceId = sourceId;
	}

	
	
	
	
	
	
}


